package com.zbkj.admin.vo;


import cn.idev.excel.annotation.ExcelProperty;
import com.pig4cloud.plugin.excel.annotation.DictTypeProperty;
import com.pig4cloud.plugin.excel.vo.DictEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serial;
import java.io.Serializable;

/**
 * 订单Excel VO对象
 *
 * @Author 莫名
 * @Date 2023/6/28 12:24
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Schema(description = "OrderExcelVo 订单Excel VO对象")
public class OrderExcelVo implements Serializable {

    @Serial
    private static final long serialVersionUID = -8330957183745338822L;

    @ExcelProperty("订单类型")
//    @DictTypeProperty(enums = OrderType.class)
    @Schema(description = "订单类型:0-普通订单，1-视频号订单,2-秒杀订单")
    private String type;

    @ExcelProperty("订单号")
    @Schema(description = "订单号")
    private String orderNo;

    @ExcelProperty("商户名称")
    @Schema(description = "商户名称")
    private String merName;

    @ExcelProperty("用户昵称")
    @Schema(description = "用户昵称")
    private String userNickname;

    @ExcelProperty("成本价")
    @Schema(description = "成本价")
    private String costPrice;

    @ExcelProperty("实际支付金额")
    @Schema(description = "实际支付金额")
    private String payPrice;

    @ExcelProperty("支付状态")
    @Schema(description = "支付状态")
    private String paidStr;

    @ExcelProperty("支付方式")
//    @DictTypeProperty(enums = PayType.class)
    @Schema(description = "支付方式:weixin,alipay,yue")
    private String payType;

    @ExcelProperty("支付来源")
    @Schema(description = "支付渠道：public-公众号,mini-小程序，h5-网页支付,yue-余额，wechatIos-微信Ios，wechatAndroid-微信Android,alipay-支付宝，alipayApp-支付宝App")
    private String payChannel;

    @ExcelProperty("订单状态")
//    @DictTypeProperty(enums = OrderStatusType.class)
    @Schema(description = "订单状态（0：待支付，1：待发货,2：部分发货， 3：待核销，4：待收货,5：已收货,6：已完成，9：已取消）")
    private String status;

    @ExcelProperty("退款状态")
//    @DictTypeProperty(enums = RefundStatusType.class)
    @Schema(description = "退款状态：0 未退款 1 申请中 2 部分退款 3 已退款")
    private String refundStatus;

    @ExcelProperty("创建时间")
    @Schema(description = "创建时间")
    private String createTime;

    @ExcelProperty("商品名称")
    @Schema(description = "商品名称")
    private String productInfo;

    @ExcelProperty("商品规格")
    @Schema(description = "商品规格")
    private String productSku;

    @ExcelProperty("购买数量")
    @Schema(description = "购买数量")
    private String productNum;

    @ExcelProperty("微信交易流水号")
    @Schema(description = "微信交易流水号")
    private String transactionId;

    @ExcelProperty("商品渠道")
    @Schema(description = "商品渠道")
    private String channelType;

    @ExcelProperty("收货人姓名")
    @Schema(description = "收货人姓名")
    private String realName;

    @ExcelProperty("收货人电话")
    @Schema(description = "收货人电话")
    private String userPhone;

    @ExcelProperty("收货详细地址")
    @Schema(description = "收货详细地址")
    private String userAddress;

    @ExcelProperty("用户备注")
    @Schema(description = "用户备注")
    private String userRemark;

    @ExcelProperty("商户备注")
    @Schema(description = "商户备注")
    private String merchantRemark;

    @Getter
    @RequiredArgsConstructor
    public static enum OrderType implements DictEnum {
        NORMAL("0", "普通订单"),
        VIDEO("1", "视频号订单"),
        SECKILL("2", "秒杀订单");

        // 必须有的字段
        private final String value;
        // 必须有的字段
        private final String label;

    }

    @Getter
    @RequiredArgsConstructor
    public static enum PayType implements DictEnum {
        WEIXIN("weixin", "微信"),
        ALIPAY("alipay", "支付宝"),
        YUE("yue", "余额"),
        WXPAY_IOS("wechatIos", "微信Ios"),
        WXPAY_ANDROID("wechatAndroid", "微信Android"),
        ALIPAY_APP("alipayApp", "支付宝App");

        // 必须有的字段
        private final String value;
        // 必须有的字段
        private final String label;

    }

    @Getter
    @RequiredArgsConstructor
    public static enum payChannelType implements DictEnum {
        PUBLIC("public", "公众号"),
        MINI("mini", "小程序"),
        H5("h5", "网页支付"),
        YUE("yue", "余额"),
        WXPAY_IOS("wechatIos", "微信Ios"),
        WXPAY_ANDROID("wechatAndroid", "微信Android"),
        ALIPAY_APP("alipayApp", "支付宝App");

        // 必须有的字段
        private final String value;
        // 必须有的字段
        private final String label;

    }

    @Getter
    @RequiredArgsConstructor
    public static enum OrderStatusType implements DictEnum {
        WAIT_PAY("0", "待支付"),
        WAIT_DELIVER("1", "待发货"),
        WAIT_DELIVER_PART("2", "部分发货"),
        WAIT_USE("3", "待核销"),
        WAIT_TAKE("4", "待收货"),
        TAKE_SUCCESS("5", "已收货"),
        COMPLETE("6", "已完成"),
        CANCEL("9", "已取消");

        // 必须有的字段
        private final String value;
        // 必须有的字段
        private final String label;

    }

    @Getter
    @RequiredArgsConstructor
    public static enum RefundStatusType implements DictEnum {
        NONE("0", "未退款"),
        APPLY("1", "申请中"),
        PART("2", "部分退款"),
        SUCCESS("3", "已退款");

        // 必须有的字段
        private final String value;
        // 必须有的字段
        private final String label;

    }
}
